﻿namespace Tools.Android
{
    [Serializable]
    public class ConnectionInfo
    {
        public string ConnectionName { get; set; }
        public string Server { get; set; }
        public int Port { get; set; } = 3306; // MySQL默认端口
        public string Database { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }

        // 构建连接字符串
        public string GetConnectionString()
        {
            return $"Server={Server};Port={Port};Database={Database};Uid={Username};Pwd={Password};sslmode=none;CharSet=utf8;AllowLoadLocalInfile=true;AllowPublicKeyRetrieval=True;";
        }
    }
}
